import { http } from "@/utils/http.js";

// 我的库存商品
export const inventoryApi = (data) => {
  return http.request({
    method: "GET",
    url: "warehouses/inventory",
    data: data,
  });
};

// 库存统计
export const totalApi = (data) => {
  return http.request({
    method: "GET",
    url: "warehouses/total",
    data: data,
  });
};

// 库存记录
export const recordApi = (data) => {
  return http.request({
    method: "GET",
    url: "warehouses/record",
    data: data,
  });
};

// 记录类型
export const classApi = (data) => {
  return http.request({
    method: "GET",
    url: "warehouses/class",
    data: data,
  });
};

// 记录详情
export const detailsApi = (data) => {
  return http.request({
    method: "GET",
    url: "/shop/stock",
    data: data,
  });
};

// 提货
export const deliveryApi = (data) => {
  return http.request({
    method: "POST",
    url: "warehouses/delivery",
    data: data,
  });
};

// 补货
export const replenishmentApi = (data) => {
  return http.request({
    method: "POST",
    url: "warehouses/replenishment",
    data: data,
  });
};

// 赠送
export const giveApi = (data) => {
  return http.request({
    method: "POST",
    url: "warehouses/give",
    data: data,
  });
};

// 手机号查询
export const giveUserQuestApi = (data) => {
  return http.request({
    method: "POST",
    url: "warehouses/giveUserQuest",
    data: data,
  });
};

// 库存记录统计
export const recordTotalApi = (data) => {
  return http.request({
    method: "GET",
    url: "/shop/recordTotal",
    data: data,
  });
};

//库存

export const shopRecord = (data) => {
  return http.request({
    method: "get",
    url: "/shop/record",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const shopOrderCount = (data) => {
  return http.request({
    method: "get",
    url: "/shop/orderCount",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};
